CentOS 7
Sponsored Link

OpenStack Juno : Configure Heat#1
2015/01/27
 
Install OpenStack Orchestration Service (Heat).
This example shows to install Orchestration Services on the existing environment like follows.
For example, install and configure Orchestration Services on the Network Node.
                                |
+------------------+            |            +------------------------+
| [ Control Node ] |            |            |    [ Network Node ]    |
|     Keystone     |10.0.0.30   |   10.0.0.50|    DHCP,L3,L2 Agent    |
|      Glance      |------------+------------|     Metadata Agent     |
|     Nova API     |eth0        |        eth0|    Heat API,API-CFN    |
|  Neutron Server  |            |            |       Heat Engine      |
+------------------+            |            +------------------------+
                            eth0|10.0.0.51
                      +--------------------+
                      |  [ Compute Node ]  |
                      |    Nova Compute    |
                      |      L2 Agent      |
                      +--------------------+

 
Add users or databases for Heat services on the Control Node on this section.
[1] Install required packages first.
# install from RDO, EPEL

[root@dlp ~(keystone)]#
yum --enablerepo=openstack-juno,epel -y install python-openstackclient
[2] Add users and so on for Heat services in Keystone on the Control Node.
# add Heat user

[root@dlp ~(keystone)]#
keystone user-create --tenant service --name heat --pass servicepassword --enabled true

+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|  email   |                                  |
| enabled  |               True               |
|    id    | bd8a752a43b640f4a1aef2fc7c793bca |
|   name   |               heat               |
| tenantId | 9e657ab1d2344de5aa9d86006732c7f0 |
| username |               heat               |
+----------+----------------------------------+

[root@dlp ~(keystone)]#
keystone user-create --tenant service --name heat-cfn --pass servicepassword --enabled true

+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|  email   |                                  |
| enabled  |               True               |
|    id    | f0d097806f3f4551902e9837ad6ba19a |
|   name   |             heat-cfn             |
| tenantId | 9e657ab1d2344de5aa9d86006732c7f0 |
| username |             heat-cfn             |
+----------+----------------------------------+

# add Heat user to admin role

[root@dlp ~(keystone)]#
keystone user-role-add --user heat --tenant service --role admin

[root@dlp ~(keystone)]#
keystone user-role-add --user heat-cfn --tenant service --role admin
# create the role for Heat

[root@dlp ~(keystone)]#
keystone role-create --name heat_stack_owner

+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|    id    | 864d549696d8483ba5abb4d39502c6e1 |
|   name   |         heat_stack_owner         |
+----------+----------------------------------+

[root@dlp ~(keystone)]#
keystone role-create --name heat_stack_user

+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|    id    | 1e1a4d5629bf44ef92da25e2d2dd1fef |
|   name   |         heat_stack_user          |
+----------+----------------------------------+

# add admin user to heat_stack_owner role

[root@dlp ~(keystone)]#
keystone user-role-add --user admin --tenant admin --role heat_stack_owner
# create service entry for Heat

[root@dlp ~(keystone)]#
keystone service-create --name=heat --type=orchestration --description="Orchestration Service"

+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |      Orchestration Service       |
|   enabled   |               True               |
|      id     | 4ce6b6d9352848328b90ca678ce9a95f |
|     name    |               heat               |
|     type    |          orchestration           |
+-------------+----------------------------------+

[root@dlp ~(keystone)]#
keystone service-create --name=heat-cfn --type=cloudformation --description="Cloudformation Service"

+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |      Cloudformation Service      |
|   enabled   |               True               |
|      id     | e5c757c5bf5f43129cc2c451f93af5d9 |
|     name    |             heat-cfn             |
|     type    |          cloudformation          |
+-------------+----------------------------------+

# define Heat API server's IP

[root@dlp ~(keystone)]#
HEAT_API=10.0.0.50
# create endpoint entry for Heat

[root@dlp ~(keystone)]#
keystone endpoint-create --region RegionOne \
--service heat \
--publicurl "http://$HEAT_API:8004/v1/\$(tenant_id)s" \
--internalurl "http://$HEAT_API:8004/v1/\$(tenant_id)s" \
--adminurl "http://$HEAT_API:8004/v1/\$(tenant_id)s"

+-------------+----------------------------------------+
|   Property  |                 Value                  |
+-------------+----------------------------------------+
|   adminurl  | http://10.0.0.50:8004/v1/$(tenant_id)s |
|      id     |    d3963a9e81a04f0ea3b767cffbbd52b1    |
| internalurl | http://10.0.0.50:8004/v1/$(tenant_id)s |
|  publicurl  | http://10.0.0.50:8004/v1/$(tenant_id)s |
|    region   |               RegionOne                |
|  service_id |    9362f63bbd0e4bcfad1e54966673eb88    |
+-------------+----------------------------------------+

[root@dlp ~(keystone)]#
keystone endpoint-create --region RegionOne \
--service heat-cfn \
--publicurl "http://$HEAT_API:8000/v1" \
--internalurl "http://$HEAT_API:8000/v1" \
--adminurl "http://$HEAT_API:8000/v1"

+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
|   adminurl  |     http://10.0.0.50:8000/v1     |
|      id     | 9388e384f6454d43979c0be779293ca6 |
| internalurl |     http://10.0.0.50:8000/v1     |
|  publicurl  |     http://10.0.0.50:8000/v1     |
|    region   |            RegionOne             |
|  service_id | 213530d8591f491ea12055f4494bbd3e |
+-------------+----------------------------------+

# create Heat domain

[root@dlp ~(keystone)]#
KEYSTONE_IP=10.0.0.30

[root@dlp ~(keystone)]#
ADMIN_TOKEN=`grep '^admin_token' /etc/keystone/keystone.conf | cut -d'=' -f2`

[root@dlp ~(keystone)]#
openstack --os-token $ADMIN_TOKEN \
--os-url=http://$KEYSTONE_IP:5000/v3 \
--os-identity-api-version=3 \
domain create heat \
--description "Owns users and projects created by heat"

+-------------+-----------------------------------------+
| Field       | Value                                   |
+-------------+-----------------------------------------+
| description | Owns users and projects created by heat |
| enabled     | True                                    |
| id          | f1fd51925eed483a88bff3053d16b1b7        |
| name        | heat                                    |
+-------------+-----------------------------------------+

# create admin user for Heat domain

[root@dlp ~(keystone)]#
HEAT_DOMAIN=`openstack --os-token $ADMIN_TOKEN --os-url=http://$KEYSTONE_IP:5000/v3 --os-identity-api-version=3 domain list | grep heat | awk '{print $2}'`

[root@dlp ~(keystone)]#
openstack --os-token $ADMIN_TOKEN \
--os-url=http://$KEYSTONE_IP:5000/v3 \
--os-identity-api-version=3 \
user create heat_domain_admin \
--password domainpassword \
--domain $HEAT_DOMAIN \
--description "Manages users and projects created by heat"

+-------------+--------------------------------------------+
| Field       | Value                                      |
+-------------+--------------------------------------------+
| description | Manages users and projects created by heat |
| domain_id   | f1fd51925eed483a88bff3053d16b1b7           |
| enabled     | True                                       |
| id          | 707fab244c154254853a7ecfe373a8f9           |
| name        | heat_domain_admin                          |
+-------------+--------------------------------------------+

# add Heat domain admin to admin role

[root@dlp ~(keystone)]#
HEAT_DOMAIN_ADMIN=`openstack --os-token $ADMIN_TOKEN --os-url=http://$KEYSTONE_IP:5000/v3 --os-identity-api-version=3 user list | grep heat_domain_admin | awk '{print $2}'`

[root@dlp ~(keystone)]#
openstack --os-token $ADMIN_TOKEN \
--os-url=http://$KEYSTONE_IP:5000/v3 \
--os-identity-api-version=3 \
role add --user $HEAT_DOMAIN_ADMIN \
--domain $HEAT_DOMAIN admin

[3] Create a database for Heat to MariaDB.
[root@dlp ~(keystone)]#
mysql -u root -p

Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 16
Server version: 5.5.40-MariaDB-wsrep MariaDB Server, wsrep_25.11.r4026

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
create database heat;

Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on heat.* to heat@'localhost' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on heat.* to heat@'%' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
flush privileges;

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
exit

Bye
 
Tweet